package com.atguigu.cmsService.controller;


import com.atguigu.cmsService.entity.CrmBanner;
import com.atguigu.cmsService.service.CrmBannerService;
import com.atguigu.commonUtils.Result;
import com.atguigu.commonUtils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author Chen Wen bo
 * @since 2021-08-10
 */
@Api(tags = "轮播图展示")
@RestController
@RequestMapping("/cmsService/bannerFront")
@CrossOrigin
public class BannerFrontController {

    @Resource
    private CrmBannerService crmBannerService;

    @ApiOperation("查询所有轮播图")
    @GetMapping("/getBannerList")
    public Result<List<CrmBanner>> getBannerList(){
        List<CrmBanner> crmBannerList = crmBannerService.getBannerList();
        return ResultUtil.success(crmBannerList);
    }

}

